<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('iOS上报列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <p>kkid：</p>
                                <input type="text" name="kkid"/>
                            </li>
                            <li>
                                <p>uuid：</p>
                                <input type="text" name="uuid"/>
                            </li>
                            <li>
                                <p>ip：</p>
                                <input type="text" name="ip"/>
                            </li>
                            <li>
                                <p>应用：</p>
                                <select name="appId" th:with="type=${@dict.getType('storage_app_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var detailFlag = [[${@permission.hasPermi('user:ioslog:detail')}]];
        var editFlag = [[${@permission.hasPermi('user:ioslog:edit')}]];
        var removeFlag = [[${@permission.hasPermi('user:ioslog:remove')}]];
        var opDatas = [[${@dict.getType('ios_log_type')}]];
        var appIdDatas = [[${@dict.getType('storage_app_type')}]];
        var prefix = ctx + "user/ioslog";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                detailUrl: prefix + "/detail/{id}",
                exportUrl: prefix + "/export",
                sortName: "createdTime",
		        sortOrder: "desc",
                modalName: "iOS上报",
                columns: [{
                    checkbox: true
                },
                {
                    field : 'id', 
                    title : 'id',
                    visible: false
                },
                {
                    field : 'appId',
                    title : '应用',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(appIdDatas, value);
                    }
                },
                {
                    field : 'kkid', 
                    title : 'kkid'
                },
                {
                    field : 'uuid', 
                    title : 'uuid'
                },
                {
                    field : 'ua', 
                    title : 'ua'
                },
                {
                    field : 'ip', 
                    title : 'ip',
                    formatter: function(value, row, index) {
                    	if(row.ipInfo){
                    	    return value + "[" + row.ipInfo + "]";
                        }else{
                        	return value;
                        }
                    }
                },
                {
                    field : 'op', 
                    title : '上报类型',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(opDatas, value) + `[${value}]`;
                    }
                },
                {
                    field : 'createdTime', 
                    title : '上报时间'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>查看参数</a>');
		                return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>